home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7350 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c,comp.lang.c++,comp.os.ms-windows.programmer.misc,comp.os.msdos.programmer,comp.programming
  4. Subject: Re: NMI Interrupt Handler Code Needed
  5. Date: 22 Feb 1996 10:51:24 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4gidvcINNo6@keats.ugrad.cs.ubc.ca>
  8. References: <4g18qj$640@tracy.protocom.com>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <4g18qj$640@tracy.protocom.com>,
  12. Michael J. Karas <mkaras@pclink.com> wrote:
  13.  >I would be interested if anyone out there has a code snippet in
  14.  >C or assembler for an interrupt handler for a PC NMI interrupt. I have
  15.  
  16. Interrupt handlers are beyond the scope of the C language. At least some
  17. portion of an interrupt handler is usually done in assembly language. A handler
  18. must preserve the machine context (things like registers, flags and the
  19. like)---objects to which access from the C language is not standardized.
  20.  
  21. The assembly-language handler can set up the right conditions so that a C
  22. service routine can be called, perhaps with relevant parameters.
  23.  
  24.  >to program an ISA bus adapter card that generates an NMI interrupt on
  25.  >the BUS line (IO_CHAN_CHK) to the CPU. This adapter generates the
  26.  >interrupt condition at the time that a watch dog timer expires,
  27.  >presumably at a time that a glitch has caused a software crash. Any help
  28.  >would be appreciated.
  29.  
  30. This is a very architecture-specific question. You might be able to get good
  31. answers on comp.lang.asm.x86. I don't know what OS you are writing under (or
  32. whether you are even using 32-bit code or not), so I'm hesitant to direct your
  33. to an MSDOS newsgroup, though I see you have cross-posted there already. If you
  34. use a real operating system, it probably has an NMI handler already, or it may
  35. let kernel-level modules install their own interrupt vectors through a special
  36. interface set up for that purpose.
  37. -- 
  38.  
  39.